package com.example.onlineanswer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.onlineanswer.model.entity.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 角色Mapper接口
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    /**
     * 根据角色编码查询角色
     *
     * @param roleCode 角色编码
     * @return 角色信息
     */
    @Select("SELECT * FROM sys_role WHERE role_code = #{roleCode} AND is_deleted = 0")
    SysRole getByRoleCode(@Param("roleCode") String roleCode);
} 